package day03;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class A01_Servlet生命周期 extends HttpServlet {

    // Servlet对象被创建之前被Tomcat调用
    @Override
    public void init(ServletConfig config) throws ServletException {

    }
    // 在Servlet被销毁时执行
    @Override
    public void destroy() {

    }

    /**
     * 1.Servlet对象创建时机
     *      默认:第一次请求到达该Servlet的时候
     */
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
              doGet(req, resp);
    }
}
